import pytest

#定义函数  求和
def add(x,y):
    return x+y

#定义测试用例
class TestAdd:
    def test_add_01(self):
        result=add(1,1)
        assert  2==result
    def test_add_02(self):
        result = add(0, 1)
        assert result==1
    def test_add_03(self):
        result = add(0, 0)
        assert result==0

    #实现 代码和数据的分离

    def test_add(self):

        data=[(1,1,2),(0,1,1),(0,0,0)]

        for a,b,expect in data:
            print(a,b,expect)
            result=add(a,b)
            assert  expect == result


if __name__ == '__main__':
    pytest.main(['-s','hm_07_参数化引入案例.py'])